import React from "react";
import '../../css/common.css'
import Film from './Film'
import Camera from './Camera'
import Center from './Center'
import TabBar from './TabBar'
import NavBar from './NavBar'
export default class App extends React.Component{
    constructor(){
        super()
        this.state={
            current:0
        }
    }
    
    switchNavigation(){
        switch(this.state.current){
            case 0:return <Film/>;
            case 1:return <Camera/>
            case 2:return <Center/>
            default:return null
        }
    }
    render(){
        return(
            <div>
                <NavBar change={()=>{this.setState({current:2})}}/>
                {this.switchNavigation()}
                <TabBar handleChange={(i)=>{this.setState({current:i})}} current={this.state.current}/>
            </div>
            
        )
    }
}